﻿<%@ Page Language="C#" MasterPageFile="../../MasterPage.Master" AutoEventWireup="true" CodeBehind="ICM_Purchase_Request.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Form.ICM_Purchase_Request" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" tagprefix="telerik" %>
<%@ Register TagPrefix="custom" Namespace="KPIS.Customs.UI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function onTextChangeGeneral(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
            }
            function RowDbClick(sender, eventArgs) {
                var hiddenElement = document.getElementById("<%= hdSeq.ClientID %>");
                hiddenElement.value = eventArgs.getDataKeyValue("Seq");
                $find("<%= RadManager1.ClientID %>").ajaxRequest(hiddenElement.value);
            }

            function SeqClick(seq) {
                var hiddenElement = document.getElementById("<%= hdSeq.ClientID %>");
                hiddenElement.value = seq;
                radopen('../Edit_Form/ICM_Purchase_Request.aspx?Seq=' + seq, 'WindowDetail');
            }

            function SeqClick_Urgent(seq) {
                var hiddenElement = document.getElementById("<%= hdSeq.ClientID %>");
                hiddenElement.value = seq;
                radopen('../Edit_Form/ICM_Purchase_Request_Urgent.aspx?Seq=' + seq, 'WindowDetail_Urgent');
            }

            var cancelDropDownClosing = false;

            function StopPropagation(e) {
                e.cancelBubble = true;
                if (e.stopPropagation) {
                    e.stopPropagation();
                }
            }

            function OnClientDropDownClosingHandler(sender, e) {
                e.set_cancel(cancelDropDownClosing);
            }

            function OnClientNodeClickingHandler(sender, e) {
                var node = e.get_node();
                if (node.get_category() == "Type") {
                    node.toggle();
                }
                else {
                    var combo = $find('<%= cbJobSite.ClientID %>');
                    combo.set_text(node.get_text());
                    cancelDropDownClosing = false;
                    combo.hideDropDown();
                }
            }

            function onTextChange(sender) {
                var tree = $find('<%= ((RadTreeView)((RadComboBox)cbJobSite).Items[0].FindControl("TreeViewJobSite")).ClientID %>');
                var node = tree.findNodeByText(sender.get_text());
                if (node == null) {
                    sender.set_text("");
                }
            }

            function closeRadWindow(sender, args) {
                var controller = Telerik.Web.UI.RadToolTipController.getInstance();
                var tooltip = controller.get_activeToolTip();
                if (tooltip) { 
                    tooltip.set_autoCloseDelay(100);
                }
                $find("<%= RadManager1.ClientID %>").ajaxRequest('CloseWindow');
            }

            function closeRadWindow_Urgent(sender, args) {
                $find("<%= RadManager1.ClientID %>").ajaxRequest('CloseWindow_Urgent');
            }

            function ExpandPersonal(sender, Args) {
                if (!sender._loaded) {
                    $find("<%=RadAjaxPanel1.ClientID %>").ajaxRequest();
                    sender._loaded = true;
                }
            }
            
            function CollapsePane()
            {
                var slidingZone = $find("<%= SlidingZone1.ClientID %>");
                var panes = slidingZone.GetPanes();
                slidingZone.collapsePane(panes[1].get_id());
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" Skin="Outlook">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager runat="server" ID="RadManager1" OnAjaxRequest="RadManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                    <telerik:AjaxUpdatedControl ControlID="PanelSearch" />
                    <telerik:AjaxUpdatedControl ControlID="RadMultipage1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnShow">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1"  />
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Grid" />
                    <telerik:AjaxUpdatedControl ControlID="Grid_Urgent" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    
    <asp:Panel runat="server" ID="panelHidden">
        <asp:HiddenField ID="hdSeq" runat="server" Value="" />
    </asp:Panel>
    <telerik:RadSplitter id="RadSplitter1" runat="server" height="460" width="1000" Skin="Office2007">
        <telerik:RadPane id="LeftPane" runat="server" width="22" Scrolling="None" Locked="true">
            <telerik:RadSlidingZone id="SlidingZone1" runat="server" width="22" ClickToOpen="true">
                <telerik:RadSlidingPane id="PaneUser" title="ข้อมูลส่วนตัว" runat="server" width="265" IconUrl="../Image/General/user.gif" EnableDock="false" OnClientBeforeExpand="ExpandPersonal">
                    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" OnAjaxRequest="OnAjaxRequest">
                    </telerik:RadAjaxPanel>
                </telerik:RadSlidingPane>
                <telerik:RadSlidingPane id="PaneSearch" title="กรองข้อมูล" runat="server" width="400" IconUrl="../Image/Tree/search.gif" EnableDock="false">
                    <asp:Panel ID="PanelPaneSearch" runat="server">
                        <table width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="10px">
                                </td>
                                <td>
                                    <div class="bigModuleLeftTree">
                                        <div class="bigModuleBottomLeftTree">
                                            <div class="header-grid">
                                                <asp:Label ID="lblHeaderPurchaseType" runat="server" Text="กรองข้อมูล"></asp:Label>
                                            </div>
                                            <asp:Panel CssClass="panelTree" ID="PanelSearch" runat="server" ScrollBars="Auto">
                                                <table width="100%" class="font-label">
                                                    <tr>
                                                        <td width="50px">
                                                        </td>
                                                        <td width="100%">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width = "100px">
                                                                        ประเภทปี :
                                                                    </td>
                                                                    <td width="150px">
                                                                        <telerik:RadComboBox CssClass="RadComboBox" runat="server" ID="cbYearType" AllowCustomText="true" ShowDropDownOnTextboxClick="true"
                                                                            Filter="Contains" DataTextField="Name" DataValueField="Seq" Width="150px" 
                                                                            EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." LoadingMessage="กำลังโหลดข้อมูล ..." MarkFirstMatch="false" 
                                                                            OnClientTextChange="onTextChangeGeneral" ValidationGroup="ValSerach">
                                                                        </telerik:RadComboBox> 
                                                                    </td>
                                                                    <td>
                                                                        <label id="Label1" runat="server"><font color="red">*</font></label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                    </td>
                                                                    <td>
                                                                        <asp:RequiredFieldValidator ID="ValcbYearType" runat="server" ControlToValidate="cbYearType" SetFocusOnError="True" Display="Dynamic" ErrorMessage="* กรุณาระบุประเภทปี *" ValidationGroup="ValSerach"></asp:RequiredFieldValidator>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                        </td>
                                                        <td>
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width = "100px">
                                                                        ปี :
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadNumericTextBox ID="txtYear" Runat="server" Width="100px" Skin="Outlook" NumberFormat-GroupSeparator="" NumberFormat-DecimalDigits="0" ValidationGroup="ValSerach"></telerik:RadNumericTextBox>
                                                                        <label id="Label2" runat="server"><font color="red">*</font></label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                    </td>
                                                                    <td>
                                                                        <asp:RequiredFieldValidator ID="ValtxtYear" runat="server" ControlToValidate="txtYear" SetFocusOnError="True" Display="Dynamic" ErrorMessage="* กรุณาระบุปี *" ValidationGroup="ValSerach"></asp:RequiredFieldValidator>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                        </td>
                                                        <td>
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width = "100px">
                                                                        หน่วยงาน :
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadComboBox CssClass="RadComboBox" ID="cbJobSite" Runat="server" Skin="Outlook" Width="220px" Height="200px"
                                                                        AllowCustomText="true" ShowDropDownOnTextboxClick="true" EmptyMessage=".. แสดงทั้งหมด .." 
                                                                        LoadingMessage="กำลังโหลดข้อมูล ..." MarkFirstMatch="false"
                                                                        OnClientTextChange="onTextChange" OnClientDropDownClosing="OnClientDropDownClosingHandler">
                                                                            <ItemTemplate>
                                                                                <div onclick="StopPropagation(event)">
                                                                                    <telerik:RadTreeView CssClass="TreeView" ID="TreeViewJobSite" runat="server" Skin="Outlook" MultipleSelect="false"
                                                                                    DataTextField="Name" DataValueField="Id" DataFieldID="Id" DataFieldParentID="Parent_id"
                                                                                    OnClientNodeClicking="OnClientNodeClickingHandler">
                                                                                        <DataBindings>
                                                                                            <telerik:RadTreeNodeBinding Depth="0" Category="Type" />
                                                                                        </DataBindings>
                                                                                    </telerik:RadTreeView>
                                                                                </div>
                                                                            </ItemTemplate>
                                                                            <Items>
                                                                                <telerik:RadComboBoxItem />
                                                                            </Items>
                                                                        </telerik:RadComboBox>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <asp:Panel ID="panelSearchForNormal" runat="server">
                                                        <tr>
                                                            <td width="50px">
                                                            </td>
                                                            <td width="100%">
                                                                <table width="100%">
                                                                    <tr>
                                                                        <td width = "100px">
                                                                            ประเภทการจัดหา :
                                                                        </td>
                                                                        <td>
                                                                            <telerik:RadComboBox CssClass="RadComboBox" runat="server" ID="cbPurchaseType" AllowCustomText="true" ShowDropDownOnTextboxClick="true"
                                                                                Filter="Contains" DataTextField="Name" DataValueField="Seq" Width="180px"
                                                                                EmptyMessage=".. แสดงทั้งหมด .." LoadingMessage="กำลังโหลดข้อมูล ..." MarkFirstMatch="false" 
                                                                                OnClientTextChange="onTextChangeGeneral">
                                                                            </telerik:RadComboBox>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td width="50px">
                                                            </td>
                                                            <td width="100%">
                                                                <table width="100%">
                                                                    <tr>
                                                                        <td width = "100px">
                                                                            วิธีการจัดหา :
                                                                        </td>
                                                                        <td>
                                                                            <telerik:RadComboBox CssClass="RadComboBox" runat="server" ID="cbPurchaseMethod" AllowCustomText="true" ShowDropDownOnTextboxClick="true"
                                                                                Filter="Contains" DataTextField="Name" DataValueField="Name" Width="200px"
                                                                                EmptyMessage=".. แสดงทั้งหมด .." LoadingMessage="กำลังโหลดข้อมูล ..." MarkFirstMatch="false" 
                                                                                OnClientTextChange="onTextChangeGeneral">
                                                                            </telerik:RadComboBox>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </asp:Panel>
                                                    <tr>
                                                        <td width="50px">
                                                        </td>
                                                        <td width="100%">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width = "100px">
                                                                        ผู้ดำเนินการ :
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadComboBox CssClass="RadComboBox" runat="server" ID="cbOperationName" AllowCustomText="true" ShowDropDownOnTextboxClick="true"
                                                                            Filter="Contains" DataTextField="Name" DataValueField="Seq" Width="200px"
                                                                            EmptyMessage=".. แสดงทั้งหมด .." LoadingMessage="กำลังโหลดข้อมูล ..." MarkFirstMatch="false" 
                                                                            OnClientTextChange="onTextChangeGeneral">
                                                                        </telerik:RadComboBox>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="50px">
                                                        </td>
                                                        <td width="100%">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width = "100px">
                                                                        สถานะรายการ :
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadComboBox CssClass="RadComboBox" runat="server" ID="cbStatus" AllowCustomText="true" ShowDropDownOnTextboxClick="true"
                                                                            Filter="Contains" DataTextField="Name" DataValueField="Status" Width="150px"
                                                                            EmptyMessage=".. แสดงทั้งหมด .." LoadingMessage="กำลังโหลดข้อมูล ..." MarkFirstMatch="false" 
                                                                            OnClientTextChange="onTextChangeGeneral">
                                                                        </telerik:RadComboBox>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <br />
                                                <div align="center">
                                                    <asp:Panel ID="panelShow" runat="server">
                                                        <asp:LinkButton CssClass="button-next-background" ID="btnShow" runat="server" Text="แสดงข้อมูล" onclick="btnShow_Click" ValidationGroup="ValSerach" OnClientClick="CollapsePane();"></asp:LinkButton>
                                                    </asp:Panel>
                                                </div>
                                            </asp:Panel>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </telerik:RadSlidingPane>
            </telerik:RadSlidingZone>
        </telerik:RadPane>
        <telerik:RadSplitBar id="RadSplitBar1" runat="server"></telerik:RadSplitBar>
        <telerik:RadPane id="PaneData" runat="server" Scrolling="None">
            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <div class="exampleWrapper">
                            <telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0" runat="server" MultiPageID="RadMultiPage1" Skin="Vista" CssClass="multiPage" CausesValidation="false" AutoPostBack="True" OnTabClick="RadTabStrip1_TabClick"> 
                                <Tabs>
                                    <telerik:RadTab runat="server" Text="รายการปกติ" Value="Normal" Selected="true">
                                    </telerik:RadTab>
                                    <telerik:RadTab runat="server" Text="รายการเร่งด่วน" Value="Urgent">
                                    </telerik:RadTab>
                                </Tabs>
                            </telerik:RadTabStrip>
                            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="pageView3">
                                <telerik:RadPageView ID="RadPageView1" runat="server">
                                    <table width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td>
                                                <asp:Panel ID="panelCommand" runat="server">
                                                    <div class="bigModulePaneFull">
                                                        <div class="bigModuleBottomPaneFull">
                                                            <table cellpadding="0" cellspacing="0">
                                                                <tr class="command-list">
                                                                    <td class="command-item" style="border: none">
                                                                        <asp:LinkButton ID="Delete" runat="server" CssClass="LinkButton" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')" OnClick="Delete_Click">
                                                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Delete.gif" />&nbsp;&nbsp;ลบข้อมูล
                                                                        </asp:LinkButton>
                                                                    </td>
                                                                    <td class="command-item">
                                                                        <asp:LinkButton ID="Change" runat="server" CssClass="LinkButton">
                                                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cmd_Save.gif" />&nbsp;&nbsp;เปลี่ยนผู้ดำเนินการ
                                                                        </asp:LinkButton>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>
                                                    </div> 
                                                    <telerik:RadToolTip runat="server" ID="RadToolTip" Width="580px" Height="70px" TargetControlID="Change" ShowEvent="OnClick"
                                                    IsClientID="false" Animation="Fade" Position="BottomRight" Skin="Default" Modal="true" ManualClose="true">
                                                    <table width="100%">
                                                        <tr>
                                                            <td>
                                                                <table width="98%" cellpadding="0" cellspacing="0">
                                                                    <tr>
                                                                        <td width="20px">
                                                                        </td>
                                                                        <td>
                                                                            <table>
                                                                                <tr>
                                                                                    <td width="70px" valign="top">
                                                                                        ผู้ดำเนินการ :
                                                                                    </td>
                                                                                    <td>
                                                                                        <telerik:RadComboBox runat="server" ID="cbNewOperationName" Height="230px" Width="440px" AllowCustomText="true" ShowDropDownOnTextboxClick="true"
                                                                                        EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." MarkFirstMatch="false" ShowMoreResultsBox="true" EnableLoadOnDemand="true" 
                                                                                        EnableVirtualScrolling="true" HighlightTemplatedItems="true" OnItemsRequested="cbNewOperationName_ItemsRequested"
                                                                                        OnClientTextChange="onTextChangeGeneral" ZIndex="8001">
                                                                                            <HeaderTemplate>
                                                                                                <table class="font-label" cellpadding="0" cellspacing="0">
                                                                                                    <tr>
                                                                                                        <td width="100px" align="center"><b>หน่วยงาน</b></td>
                                                                                                        <td width="100px" align="center"><b>ชื่อ-สกุล</b></td>
                                                                                                        <td width="100px" align="center"><b>ตำแหน่ง</b></td>
                                                                                                        <td width="100px" align="center"><b>ระดับ</b></td>
                                                                                                    </tr>
                                                                                                </table>
                                                                                            </HeaderTemplate>
                                                                                            <ItemTemplate>
                                                                                                <asp:Table id="tableNewOperationName" runat="server" CssClass="font-label" CellPadding="0" CellSpacing="0">
                                                                                                </asp:Table>
                                                                                            </ItemTemplate>
                                                                                        </telerik:RadComboBox>
                                                                                        &nbsp;<label id="Label14" runat="server"><font color="red">*</font></label>
                                                                                    </td>
                                                                                </tr>
                                                                                <tr>
                                                                                    <td>
                                                                                    </td>
                                                                                    <td>
                                                                                        <asp:RequiredFieldValidator ID="ValcbNewOperationName" runat="server" ControlToValidate="cbNewOperationName" SetFocusOnError="True" Display="Dynamic" ErrorMessage="* กรุณาระบุผู้ดำเนินการ *" ValidationGroup="Change"></asp:RequiredFieldValidator>
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2" align="center">
                                                                            <br />
                                                                            <asp:LinkButton ID="btnSendTo" runat="server" Text="ส่งข้อมูล" CssClass="form-button" 
                                                                                OnClientClick="javascript:return confirm('ยืนยันการเปลี่ยนแปลงผู้ดำเนินการ')"
                                                                                onclick="btnSendTo_Click" ValidationGroup="Change"></asp:LinkButton>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    </telerik:RadToolTip>   
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Panel ID="panelData" runat="server">
                                                    <div class="bigModulePaneFull">
                                                        <div class="bigModuleBottomPaneFull">
                                                            <asp:Panel ID="panelHeaderList" runat="server">
                                                                <div class="header-grid">
                                                                    <asp:Label ID="lblHeaderList" runat="server" Text="รายการขอซื้อ/จ้าง"></asp:Label>
                                                                </div>
                                                            </asp:Panel>
                                                            <asp:Panel CssClass="panelListTab" runat="server" ID="panelList" ScrollBars="Auto" Visible="false">
                                                            </asp:Panel>
                                                            <asp:Panel CssClass="panelGridTab" ID="panelGrid" runat="server" ScrollBars="Auto" Visible="true">
                                                                <div align="left">
                                                                    <telerik:RadGrid CssClass="RadGrid" ID="Grid" runat="server" AllowFilteringByColumn="true"
                                                                    AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True"
                                                                    AutoGenerateColumns="False" EnableAJAX="True" PageSize="8"
                                                                    GridLines="None" ShowStatusBar="false" Skin="Outlook" Width="95%"
                                                                    OnItemCommand="Grid_ItemCommand">
                                                                        <MasterTableView GroupLoadMode="Client" AllowMultiColumnSorting="true" DataKeyNames="Seq" ClientDataKeyNames="Seq" Width="100%">
                                                                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                                            <Columns>
                                                                                <custom:CustomClientSelectColumn UniqueName="ClientSelectColumn">
                                                                                    <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                                    <FilterTemplate> 
                                                                                        <asp:LinkButton ID="clearFilter" runat="server" ToolTip="ยกเลิกการค้นหา" OnClick="clearFilter_Click">
                                                                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cancel.gif" />
                                                                                        </asp:LinkButton>
                                                                                    </FilterTemplate> 
                                                                                </custom:CustomClientSelectColumn>
                                                                                <telerik:GridBoundColumn DataField="YearTypeDescr"
                                                                                    GroupByExpression="YearTypeDescr Group By InfoYearType.Seq, BgmYear" Groupable="true" Visible="false"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" HeaderText="ประเภทปี" 
                                                                                    UniqueName="YearTypeDescr">
                                                                                    <HeaderStyle HorizontalAlign="Left" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPurchaseMethod.Name" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="วิธีการจัดหา" 
                                                                                    UniqueName="InfoPurchaseMethod.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPurchaseType.Name" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="ประเภท" 
                                                                                    UniqueName="InfoPurchaseType.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="PurchaseDate" DataFormatString="{0:dd/MM/yyyy}"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="วันที่"
                                                                                    UniqueName="PurchaseDate">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridTemplateColumn DataField="Ref_No"  HeaderText="เลขที่"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" UniqueName="Ref_No" SortExpression="Ref_No">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="130px" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                    <ItemTemplate>
                                                                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#" onclick='<%# Eval("Seq","return SeqClick( {0} );") %>' Text='<%# Eval("Ref_No")  %>'></asp:HyperLink>
                                                                                    </ItemTemplate>
                                                                                </telerik:GridTemplateColumn>
                                                                                <telerik:GridTemplateColumn DataField="Name"  HeaderText="เรื่อง"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" UniqueName="Name" SortExpression="Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                    <ItemTemplate>
                                                                                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="#" onclick='<%# Eval("Seq","return SeqClick( {0} );") %>' Text='<%# Eval("Name")  %>'></asp:HyperLink>
                                                                                    </ItemTemplate>
                                                                                </telerik:GridTemplateColumn>
                                                                                <telerik:GridBoundColumn DataField="infoRecordStatus.Name" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="สถานะรายการ" 
                                                                                    UniqueName="infoRecordStatus.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="Seq" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="Seq" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoYearType.Seq"
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoYearType.Seq"
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="BgmYear"
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="BgmYear"
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                                                </telerik:GridBoundColumn>
                                                                            </Columns>
                                                                        </MasterTableView>
                                                                        <ClientSettings EnableRowHoverStyle="true" >
                                                                            <Selecting AllowRowSelect="True" />
                                                                            <ClientEvents OnRowDblClick="RowDbClick" />
                                                                        </ClientSettings>
                                                                    </telerik:RadGrid>
                                                                </div>
                                                                <br />
                                                            </asp:Panel>
                                                        </div>
                                                    </div>
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                    </table>
                                </telerik:RadPageView>
                                <telerik:RadPageView ID="RadPageView2" runat="server">
                                    <table width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td>
                                                <asp:Panel ID="panelCommand_Urgent" runat="server">
                                                    <div class="bigModulePaneFull">
                                                        <div class="bigModuleBottomPaneFull">
                                                            <table cellpadding="0" cellspacing="0">
                                                                <tr class="command-list">
                                                                    <td class="command-item" style="border: none">
                                                                        <asp:LinkButton ID="Delete_Urgent" runat="server" CssClass="LinkButton" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')" OnClick="Delete_Urgent_Click">
                                                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Delete.gif" />&nbsp;&nbsp;ลบข้อมูล
                                                                        </asp:LinkButton>
                                                                    </td>
                                                                    <td class="command-item">
                                                                        <asp:LinkButton ID="Change_Urgent" runat="server" CssClass="LinkButton">
                                                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cmd_Save.gif" />&nbsp;&nbsp;เปลี่ยนผู้ดำเนินการ
                                                                        </asp:LinkButton>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>
                                                    </div> 
                                                    <telerik:RadToolTip runat="server" ID="RadToolTip_Urgent" Width="580px" Height="70px" TargetControlID="Change_Urgent" ShowEvent="OnClick"
                                                    IsClientID="false" Animation="Fade" Position="BottomRight" Skin="Default" Modal="true" ManualClose="true">
                                                    <table width="100%">
                                                        <tr>
                                                            <td>
                                                                <table width="98%" cellpadding="0" cellspacing="0">
                                                                    <tr>
                                                                        <td width="20px">
                                                                        </td>
                                                                        <td>
                                                                            <table>
                                                                                <tr>
                                                                                    <td width="70px" valign="top">
                                                                                        ผู้ดำเนินการ :
                                                                                    </td>
                                                                                    <td>
                                                                                        <telerik:RadComboBox runat="server" ID="cbNewOperationName_Urgent" Height="230px" Width="440px" AllowCustomText="true" ShowDropDownOnTextboxClick="true"
                                                                                        EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." MarkFirstMatch="false" ShowMoreResultsBox="true" EnableLoadOnDemand="true" 
                                                                                        EnableVirtualScrolling="true" HighlightTemplatedItems="true" OnItemsRequested="cbNewOperationName_Urgent_ItemsRequested"
                                                                                        OnClientTextChange="onTextChangeGeneral" ZIndex="8001">
                                                                                            <HeaderTemplate>
                                                                                                <table class="font-label" cellpadding="0" cellspacing="0">
                                                                                                    <tr>
                                                                                                        <td width="100px" align="center"><b>หน่วยงาน</b></td>
                                                                                                        <td width="100px" align="center"><b>ชื่อ-สกุล</b></td>
                                                                                                        <td width="100px" align="center"><b>ตำแหน่ง</b></td>
                                                                                                        <td width="100px" align="center"><b>ระดับ</b></td>
                                                                                                    </tr>
                                                                                                </table>
                                                                                            </HeaderTemplate>
                                                                                            <ItemTemplate>
                                                                                                <asp:Table id="tableNewOperationName_Urgent" runat="server" CssClass="font-label" CellPadding="0" CellSpacing="0">
                                                                                                </asp:Table>
                                                                                            </ItemTemplate>
                                                                                        </telerik:RadComboBox>
                                                                                        &nbsp;<label id="Label3" runat="server"><font color="red">*</font></label>
                                                                                    </td>
                                                                                </tr>
                                                                                <tr>
                                                                                    <td>
                                                                                    </td>
                                                                                    <td>
                                                                                        <asp:RequiredFieldValidator ID="ValcbNewOperationName_Urgent" runat="server" ControlToValidate="cbNewOperationName_Urgent" SetFocusOnError="True" Display="Dynamic" ErrorMessage="* กรุณาระบุผู้ดำเนินการ *" ValidationGroup="Change_Urgent"></asp:RequiredFieldValidator>
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2" align="center">
                                                                            <br />
                                                                            <asp:LinkButton ID="btnSendTo_Urgent" runat="server" Text="ส่งข้อมูล" CssClass="form-button" 
                                                                                OnClientClick="javascript:return confirm('ยืนยันการเปลี่ยนแปลงผู้ดำเนินการ')"
                                                                                onclick="btnSendTo_Urgent_Click" ValidationGroup="Change_Urgent"></asp:LinkButton>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    </telerik:RadToolTip>   
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Panel ID="panelData_Urgent" runat="server">
                                                    <div class="bigModulePaneFull">
                                                        <div class="bigModuleBottomPaneFull">
                                                            <asp:Panel ID="panel2" runat="server">
                                                                <div class="header-grid">
                                                                    <asp:Label ID="Label4" runat="server" Text="รายการขอซื้อ/จ้างกรณีเร่งด่วน"></asp:Label>
                                                                </div>
                                                            </asp:Panel>
                                                            <asp:Panel CssClass="panelListTab" runat="server" ID="panelList_Urgent" ScrollBars="Auto" Visible="false">
                                                            </asp:Panel>
                                                            <asp:Panel CssClass="panelGridTab" ID="panelGrid_Urgent" runat="server" ScrollBars="Auto" Visible="true">
                                                                <div align="left">
                                                                    <telerik:RadGrid CssClass="RadGrid" ID="Grid_Urgent" runat="server" AllowFilteringByColumn="true"
                                                                    AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True"
                                                                    AutoGenerateColumns="False" EnableAJAX="True" PageSize="8"
                                                                    GridLines="None" ShowStatusBar="false" Skin="Outlook" Width="95%"
                                                                    OnItemCommand="Grid_Urgent_ItemCommand">
                                                                        <MasterTableView GroupLoadMode="Client" AllowMultiColumnSorting="true" DataKeyNames="Seq" ClientDataKeyNames="Seq" Width="100%">
                                                                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                                            <Columns>
                                                                                <custom:CustomClientSelectColumn UniqueName="ClientSelectColumn">
                                                                                    <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                                    <FilterTemplate> 
                                                                                        <asp:LinkButton ID="clearFilter" runat="server" ToolTip="ยกเลิกการค้นหา" OnClick="clearFilter_Urgent_Click">
                                                                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cancel.gif" />
                                                                                        </asp:LinkButton>
                                                                                    </FilterTemplate> 
                                                                                </custom:CustomClientSelectColumn>
                                                                                <telerik:GridBoundColumn DataField="YearTypeDescr"
                                                                                    GroupByExpression="YearTypeDescr Group By InfoYearType.Seq, BgmYear" Groupable="true" Visible="false"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" HeaderText="ประเภทปี" 
                                                                                    UniqueName="YearTypeDescr">
                                                                                    <HeaderStyle HorizontalAlign="Left" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPurchaseMethod.Name" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="วิธีการจัดหา" 
                                                                                    UniqueName="InfoPurchaseMethod.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPurchaseType.Name" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="ประเภท" 
                                                                                    UniqueName="InfoPurchaseType.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="PurchaseDate" DataFormatString="{0:dd/MM/yyyy}"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="วันที่"
                                                                                    UniqueName="PurchaseDate">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridTemplateColumn DataField="Ref_No"  HeaderText="เลขที่"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" UniqueName="Ref_No" SortExpression="Ref_No">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="130px" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                    <ItemTemplate>
                                                                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#" onclick='<%# Eval("Seq","return SeqClick_Urgent( {0} );") %>' Text='<%# Eval("Ref_No")  %>'></asp:HyperLink>
                                                                                    </ItemTemplate>
                                                                                </telerik:GridTemplateColumn>
                                                                                <telerik:GridTemplateColumn DataField="Name"  HeaderText="เรื่อง"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" UniqueName="Name" SortExpression="Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                    <ItemTemplate>
                                                                                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="#" onclick='<%# Eval("Seq","return SeqClick_Urgent( {0} );") %>' Text='<%# Eval("Name")  %>'></asp:HyperLink>
                                                                                    </ItemTemplate>
                                                                                </telerik:GridTemplateColumn>
                                                                                <telerik:GridBoundColumn DataField="infoRecordStatus.Name" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="สถานะรายการ" 
                                                                                    UniqueName="infoRecordStatus.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="Seq" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="Seq" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoYearType.Seq"
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoYearType.Seq"
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="BgmYear"
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="BgmYear"
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                                                </telerik:GridBoundColumn>
                                                                            </Columns>
                                                                        </MasterTableView>
                                                                        <ClientSettings EnableRowHoverStyle="true" >
                                                                            <Selecting AllowRowSelect="True" />
                                                                            <ClientEvents OnRowDblClick="RowDbClick" />
                                                                        </ClientSettings>
                                                                    </telerik:RadGrid>
                                                                </div>
                                                                <br />
                                                            </asp:Panel>
                                                        </div>
                                                    </div>
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                    </table>
                                </telerik:RadPageView>
                            </telerik:RadMultiPage>
                        </div>
                    </td>
                </tr>
            </table>
        </telerik:RadPane>
    </telerik:RadSplitter>
    <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" 
    runat="server" Skin="Vista" Modal="true" KeepInScreenBounds="false" Style="z-index: 7001">
        <Windows>
            <telerik:RadWindow ID="WindowDetail" runat="server" Width="1024px" Height="600px" Behaviors="Default" OnClientClose="closeRadWindow">
            </telerik:RadWindow>
            <telerik:RadWindow ID="WindowDetail_Urgent" runat="server" Width="1024px" Height="600px" Behaviors="Default" OnClientClose="closeRadWindow_Urgent">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager> 
</asp:Content>
